#pragma once
#include "PointLabCore/Entity.h"

#include "PointLabIO/Prerequisites.h"
#include "PointLabIO/BaseIO.h"

namespace PointLabIO
{
	class POINTLABIO_EXPORT Factory
	{
	private:
		Factory();
		~Factory();

		friend POINTLABIO_EXPORT Factory& Handler();

	public:
		bool IORegister(PointLabIO::BaseIO* bi);

		PointLabIO::POINTLAB_FILE_ERROR LoadFromFile(const std::string fileName, PointLabCore::Entity* entity, PointLabIO::Options& options);
		PointLabIO::POINTLAB_FILE_ERROR SaveToFile(const std::string fileName, PointLabCore::Entity* entity, PointLabIO::Options& options);

	public:
		const std::vector<std::string> filters()const;

	private:
		std::set<PointLabIO::BaseIO*> mIoClosses;
		std::vector<std::string> mFilters;
	};

	POINTLABIO_EXPORT PointLabIO::Factory& Handler();
}
